#include "TcpServer.hpp"
#include<iostream>
#include<string>
#include<memory>
// #include"log.hpp"

// extern Log lg;
void Usage(std::string proc)
{
    std::cout<<"Usage# "<<proc<<" [port]"<<std::endl;
}

//./tcpserver 8888
int main(int argc,char*argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(1);
    }
    lg.Enable(Screen);
    uint16_t serverport=std::stoi(argv[1]);
    std::unique_ptr<Tcpserver> tcp_ser(new Tcpserver(serverport));
    tcp_ser->InitServer();
    tcp_ser->Start();
    
    return 0;
}